from django.urls import path

from . import views
from .views import reg, log, cha, center, logout, chahead, active, AttractionList, AttractionCreate, AttractionDelete, AttractionUpdate

app_name = 'users'
urlpatterns = [
    path('reg/', reg, name='reg'),
    path('log/', log, name='log'),
    path('cha/', cha, name='cha'),
    path('logout/', logout, name='logout'),
    path('center/', center, name='center'),
    path('chahead/', chahead, name='chahead'),
    path('active/<str:encrypted_id>/', active, name='active'),

    # 景点管理URL（保持原有路径，但使用景点相关的视图类）
    path('attraction_list/', AttractionList.as_view(), name='attraction_list'),  # 用户景点列表
    path('attraction_create/', AttractionCreate.as_view(), name='attraction_create'),  # 创建景点
    path('attraction_delete/<int:pk>/', AttractionDelete.as_view(), name='attraction_delete'),  # 删除景点
    path('attraction_update/<int:pk>/', AttractionUpdate.as_view(), name='attraction_update'),  # 更新景点
    path('', AttractionList.as_view(), name='index'),  # 根路径指向景点列表
    path('profile/update/', views.profile_update, name='profile_update'),

]